package com.company;


import com.sun.corba.se.impl.encoding.OSFCodeSetRegistry;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.LinkedList;
import java.util.Map;

public class Main {

    public static void main(String[] args) {
        LinkedList<String> linkedlist = new LinkedList<String>();
        linkedlist.add("First");
        linkedlist.add("Second");
        linkedlist.add("Third");
        linkedlist.add("Fourth");
        linkedlist.addFirst("Fifth");
        linkedlist.addLast("Sixth");

        for (int i = 0; i < linkedlist.size(); i++)
            System.out.print(i + "=" + linkedlist.get(i) + " ");
        System.out.println("\nGetFirst: " + linkedlist.getFirst() + " GetLast: " + linkedlist.getLast());

        System.out.println("Adding Sheldon to the second index...");
        linkedlist.add(2, "Sheldon");

        for (int i = 0; i < linkedlist.size(); i++)
            System.out.print(i + "=" + linkedlist.get(i) + " ");
        System.out.println("\n Map Collection:");
        Map<String, String> map = new HashMap<String, String>();
        map.put("1", "First");
        map.put("2", "Second");
        map.put("3", "Third");
        map.put("4", "Fourth");
        System.out.println("All the map:");
        for (Map.Entry m : map.entrySet()) {
            System.out.println("Key: " + m.getKey() + " Value: " + m.getValue());
        }

        System.out.println("Accessing value with key 3...");
        System.out.println(map.get("3"));

        System.out.println("Deleting entry with key 3...");
        map.remove("3");
        System.out.println("After deleting:");

        for (Map.Entry m : map.entrySet()) {
            System.out.println("Key: " + m.getKey() + " Value: " + m.getValue());
        }

        //ArrayList<String> a = Just.getPlaylist("C:\\Users\\rmikhaylenko\\jmplayer\\itcrowd");
        for(String str : Just.getPlaylist("C:\\Users\\rmikhaylenko\\jmplayer\\itcrowd")) {
            System.out.println(str);
        }

    }
}
